<?php

##########################################################################################################
Function show_user_note($uid, $start=0, $limit=8)
{
	$connection = dbconnect();
	$req = dbquery("SELECT * FROM history_users_notes WHERE dest=\"$uid\" ORDER BY nid DESC LIMIT $start,$limit", $connection);
	if (@mysql_num_rows($req) == 0)
	{
		mysql_close($connection);
		Print("<br><br><br><br><center>Vous n'avez re&ccedil;u aucune notification!</center>");
		return;
	}
	
	Print("<ul id=\"notes\">");
	
	while ($line = @mysql_fetch_array($req))
	{
		$login = get_user_names($line['uid'], $connection);
		$infos = get_feed_type($line['type'], $connection);
		$date = get_fr_date($line[date]);
		Print("
			<li style=\"list-style: none;\">
				<img src=\"$_SESSION[path_apps]/profil/images/ico/$infos[ico]\">
				<a href=\"profil.php?id=$line[uid]\">$login</a> $infos[value]
				<a href=\"$line[link]\">$line[value]</a>
		");
			if ($line['type'] == 19)
			{
				$tmp = explode('=', $line['link']);
				$gid = $tmp[1];
				Print("<br><small><a href=\"profil.php?action=network&auid=$line[uid]&gid=$gid&nid=$line[nid]\">Accepter</a> - <a href=\"profil.php?action=network&iuid=$line[uid]&gid=$gid&nid=$line[nid]\">Ignorer</a></small>");
			}
		Print("
			</li>
		");
	}
	Print("</ul>");
	mysql_close($connection);
	return;

}

##########################################################################################################
Function show_user_feed($uid, $start=0, $limit=8)
{
	$req = dbquery("SELECT * FROM history_users WHERE uid=\"$uid\" ORDER BY hid DESC LIMIT $start,$limit");
	if (@mysql_num_rows($req) == 0)
	{
		Print("<br><br><br><br><center>Aucune activit&eacute; disponible!</center>");
		return;
	}
	
	Print("<ul>");
	
	$login = get_user_infos_3($uid);
	while ($line = @mysql_fetch_array($req))
	{
		$infos = get_feed_type($line['type']);
		$date = get_fr_date($line[date]);
		Print("
			<li>
				<img src=\"$_SESSION[path_apps]/profil/images/ico/$infos[ico]\">
				$login[first] $infos[value]
				<a href=\"$line[link]\">$line[value]</a>				
			</li>
		");
	}
	Print("</ul>");
	return;
}

##########################################################################################################
Function show_groups_network($uid, $start=0, $limit=1000)
{	
	$groups = get_user_groups($uid);
	if (is_array($groups))
	{
		$i = 0;
		while ($i < $limit)
		{
			if (isset($groups[$i]))
			{
				$gid = get_gid($groups[$i]);
				$pic = $_SESSION['current_path']."/images/groups.png";
				Print("
						<table border=0 width=100%>
							<tr>
								<td width=49>
									<a href=\"groups.php?gid=$gid\">
										<img src=\"$pic\" width=48 height=48>
									</a>
								</td>
								<td>
									<a href=\"groups.php?gid=$gid\" style=\"font-color: royalblue; font-weight: bold; font-size: 14px; padding-left: 20px;\">
										$groups[$i]
									</a>
								</td>
							</tr>
						</table>
				");
				if ((($i + 1) != $limit) && (isset($groups[$i + 1]) != ""))
					Print("<hr style=\"border:0;  border-top: 1px lightgray solid;\"><br>");
			}
			$i++;
		}
	}
	return;
}

?>